<?php
/**
 * Created by PhpStorm.
 * User: EDZ
 * Date: 2020/6/22
 * Time: 11:18
 */

namespace DesignPatterns\Structural\Adaptor;


class Kindle implements EBookInterface
{
    private $page = 1;

    private $totalPages = 100;

    public function unlock() {
        echo __METHOD__.PHP_EOL;
    }

    public function pressNext() {
        $this->page += 1;
    }

    /**
     * 返回当前页和总页数，像 [10, 100] 是总页数100中的第10页。
     *
     * @return int[]
     */
    public function getPage(): array {
        return [$this->page, $this->totalPages];
    }
}